package cn.tedu.mybatisdemo.mapper;

import cn.tedu.mybatisdemo.pojo.entity.Teacher;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface TeacherMapper {
    //    TODO 创建老师实体类
    @Select("SELECT * FROM teacher")
    public List<Teacher> getTeacherAll();

    @Insert("INSERT INTO teacher VALUES(666,'Tom',23,'三级',1,10000,2000,'男',4)")
    public int addTeacher();

    @Update("UPDATE teacher SET name=#{name} WHERE id = #{id}")
    public int updateTeacher(@Param("id") int id,@Param("name") String name);

    @Delete("DELETE FROM teacher WHERE id = 666")
    public int deleteTeacher();

    Teacher selectTeacherSubjectById(int id);


}


